]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Only show section title for other days
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 26 Feb 2017 03:35:43 +0000 (04:35 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 1 Mar 2017 09:55:09 +0000 (10:55 +0100)
The section titles usually don't provide a lot of value - messages
themselves are usually pretty unambiguous about their type, and
having a hidden shortcut to some settings panel or application isn't
essential either - except when showing the selected date when browsing
other days, as it adds context to the listed events. Based on that,
remove the section title as a general MessageListSection feature and
move it into the EventsSection, where we only show it when it is useful.

https://bugzilla.gnome.org/show_bug.cgi?id=775763

data/theme/gnome-shell-high-contrast.css
data/theme/gnome-shell-sass
data/theme/gnome-shell.css
js/ui/calendar.js
js/ui/messageList.js
js/ui/mpris.js

index 476dfb2ea481e5c8a2b1df3d19276bef03342f04..2714b92588f392b570472c6b8e6a98076eb2d3d8 100644 (file)
@@ -737,7 +737,7 @@ StScrollBar {
 .datemenu-today-button,
 .world-clocks-button,
 .weather-button,
-.message-list-section-title {
+.events-section-title {
   border-radius: 4px;
   padding: .4em; }
 
@@ -752,13 +752,13 @@ StScrollBar {
 .world-clocks-button:focus,
 .weather-button:hover,
 .weather-button:focus,
-.message-list-section-title:hover,
-.message-list-section-title:focus {
+.events-section-title:hover,
+.events-section-title:focus {
   background-color: #0d0d0d; }
 .datemenu-today-button:active,
 .world-clocks-button:active,
 .weather-button:active,
-.message-list-section-title:active {
+.events-section-title:active {
   color: white;
   background-color: #215d9c; }
 
@@ -767,7 +767,7 @@ StScrollBar {
 
 .world-clocks-header,
 .weather-header,
-.message-list-section-title {
+.events-section-title {
   color: #999999;
   font-weight: bold; }
 
index 8001b92b5ef26cb8ea5674c72beed6a4a6439e89..7f6d89bfcd5fa1c4238eed83dcab75949df72a4d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8001b92b5ef26cb8ea5674c72beed6a4a6439e89
+Subproject commit 7f6d89bfcd5fa1c4238eed83dcab75949df72a4d
index 40be8539d84f7d15398e4dea69ff0087ab1275bc..efac28f912e382f701191fa553525d519b20760a 100644 (file)
@@ -737,7 +737,7 @@ StScrollBar {
 .datemenu-today-button,
 .world-clocks-button,
 .weather-button,
-.message-list-section-title {
+.events-section-title {
   border-radius: 4px;
   padding: .4em; }
 
@@ -752,13 +752,13 @@ StScrollBar {
 .world-clocks-button:focus,
 .weather-button:hover,
 .weather-button:focus,
-.message-list-section-title:hover,
-.message-list-section-title:focus {
+.events-section-title:hover,
+.events-section-title:focus {
   background-color: #454c4c; }
 .datemenu-today-button:active,
 .world-clocks-button:active,
 .weather-button:active,
-.message-list-section-title:active {
+.events-section-title:active {
   color: white;
   background-color: #215d9c; }
 
@@ -767,7 +767,7 @@ StScrollBar {
 
 .world-clocks-header,
 .weather-header,
-.message-list-section-title {
+.events-section-title {
   color: #8e8e80;
   font-weight: bold; }
 
index 8669efe5b8ceeba8f379fa98c066206c023d6971..68e560e97ffd9d5cf383d909928152126e632598 100644 (file)
@@ -811,7 +811,16 @@ const EventsSection = new Lang.Class({
         this._desktopSettings.connect('changed', Lang.bind(this, this._reloadEvents));
         this._eventSource = new EmptyEventSource();
 
-        this.parent('');
+        this.parent();
+
+        this._title = new St.Button({ style_class: 'events-section-title',
+                                      label: '',
+                                      x_align: St.Align.START,
+                                      can_focus: true });
+        this.actor.insert_child_below(this._title, null);
+
+        this._title.connect('clicked', Lang.bind(this, this._onTitleClicked));
+        this._title.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
 
         Shell.AppSystem.get_default().connect('installed-changed',
                                               Lang.bind(this, this._appInstalledChanged));
@@ -832,10 +841,10 @@ const EventsSection = new Lang.Class({
     },
 
     _updateTitle: function() {
-        if (isToday(this._date)) {
-            this._title.label = _("Events");
+        this._title.visible = !isToday(this._date);
+
+        if (!this._title.visible)
             return;
-        }
 
         let dayFormat;
         let now = new Date();
@@ -897,7 +906,8 @@ const EventsSection = new Lang.Class({
     },
 
     _onTitleClicked: function() {
-        this.parent();
+        Main.overview.hide();
+        Main.panel.closeCalendar();
 
         let app = this._getCalendarApp();
         if (app.get_id() == 'evolution.desktop')
@@ -928,7 +938,7 @@ const NotificationSection = new Lang.Class({
     Extends: MessageList.MessageListSection,
 
     _init: function() {
-        this.parent(_("Notifications"));
+        this.parent();
 
         this._sources = new Map();
         this._nUrgent = 0;
@@ -1017,26 +1027,8 @@ const NotificationSection = new Lang.Class({
                 message.notification.acknowledged = true;
     },
 
-    _onTitleClicked: function() {
-        this.parent();
-
-        let app = Shell.AppSystem.get_default().lookup_app('gnome-notifications-panel.desktop');
-
-        if (!app) {
-            log('Settings panel for desktop file ' + desktopFile + ' could not be loaded!');
-            return;
-        }
-
-        app.activate();
-    },
-
     _shouldShow: function() {
         return !this.empty && isToday(this._date);
-    },
-
-    _sync: function() {
-        this.parent();
-        this._title.reactive = Main.sessionMode.allowSettings;
     }
 });
 
index 8978fa293a19c0a82a318c25382acf26d1a6c387..103878988fb0e3b1857ef47eadeaf3e8c160c614 100644 (file)
@@ -520,19 +520,10 @@ Signals.addSignalMethods(Message.prototype);
 const MessageListSection = new Lang.Class({
     Name: 'MessageListSection',
 
-    _init: function(title) {
+    _init: function() {
         this.actor = new St.BoxLayout({ style_class: 'message-list-section',
                                         clip_to_allocation: true,
                                         x_expand: true, vertical: true });
-        this._title = new St.Button({ style_class: 'message-list-section-title',
-                                      label: title,
-                                      can_focus: true,
-                                      x_expand: true,
-                                      x_align: St.Align.START });
-        this.actor.add_actor(this._title);
-
-        this._title.connect('clicked', Lang.bind(this, this._onTitleClicked));
-        this._title.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
 
         this._list = new St.BoxLayout({ style_class: 'message-list-section-list',
                                         vertical: true });
@@ -554,11 +545,6 @@ const MessageListSection = new Lang.Class({
         this._sync();
     },
 
-    _onTitleClicked: function() {
-        Main.overview.hide();
-        Main.panel.closeCalendar();
-    },
-
     _onKeyFocusIn: function(actor) {
         this.emit('key-focus-in', actor);
     },
index 825a00e424bc62b60cf9a89399d62604fdfafb70..b42d9aa57e00d5a6f3c2e18e5635c348713fe285 100644 (file)
@@ -214,7 +214,7 @@ const MediaSection = new Lang.Class({
     Extends: MessageList.MessageListSection,
 
     _init: function() {
-        this.parent(_("Media"));
+        this.parent();
 
         this._players = new Map();